﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Device.Location;

namespace YiDingCanWp7
{
    public class Utils
    {
        public static double[] GetLocationProperty()
        {
            double[] latLong = new double[2];
            GeoCoordinateWatcher watcher = new GeoCoordinateWatcher();
            watcher.TryStart(false, TimeSpan.FromMilliseconds(1000));
            GeoCoordinate coord = watcher.Position.Location;
            if (coord.IsUnknown != true)
            {
                latLong[0] = coord.Latitude;
                latLong[1] = coord.Longitude;
            }
            return latLong;
        }
    }
}
